package com.xw.unification.entity;

import lombok.Getter;
import lombok.Setter;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.mvc.method.RequestMappingInfo;

import java.lang.reflect.Method;

/**
 * Controller Mapping 包装类
 *
 * @author qiwei
 * @date 2023-8-9 21:00:00
 * @since v1.0.0
 */
@Getter
@Setter
public class ControllerMapping {
    private HandlerMethod handlerMethod;
    private RequestMappingInfo requestMappingInfo;
    private Method method;
    private Class<?> rawType;

    public ControllerMapping(HandlerMethod handlerMethod, RequestMappingInfo requestMappingInfo) {
        this.handlerMethod = handlerMethod;
        this.requestMappingInfo = requestMappingInfo;
        this.method = handlerMethod.getMethod();
        this.rawType = handlerMethod.getMethod().getDeclaringClass();
    }

}
